package Solutions;

/**
 * @Classname ReverseInt32
 * @Description TODO
 * @Date 2021/3/2 12:13
 * @Created by ASUS
 */
public class ReverseInt32 {
    public int reverse(int x) {
        int res = 0;
        while (x != 0) {
            if (res * 10 / 10 != res) return 0;
            res = 10 * res + x % 10;
            x /= 10;
        }
        return res;
    }

    public static void main(String[] args) {
        System.out.println(new ReverseInt32().reverse(1534236469));
    }
}
